<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>配置服务</title>
</head>
<body>
<div th:replace="/layout/css :: #css"></div>
<div class="container-fluid" style="width: 400px;">
    <form id="createForm" method="post" class="form-horizontal modal-form">
                     <div class="form-group">
                         <label for="serviceName" class="col-sm-3 control-label">服务名</label>
                         <div class="col-sm-8">
                             <input id="serviceName" name="serviceName" type="text" class="form-control" />
                         </div>
                     </div>
                     <div class="form-group">
                         <label for="serviceThemePath" class="col-sm-3 control-label">皮肤路径</label>
                         <div class="col-sm-8">
                             <input id="serviceThemePath" name="serviceThemePath" type="text" class="form-control" />
                         </div>
                     </div>
                     <div class="form-group">
                         <label  class="col-sm-3 control-label">是否注册服务</label>
                         <div class="col-sm-8">
                             <div class="radio">
                                 <label>
                                     <input type="radio" name="serviceRegistered" id="serviceRegistered_nomal" value="1" checked="checked" />
                                     是
                                 </label>
                             </div>
                             <div class="radio">
                                 <label>
                                     <input type="radio" name="serviceRegistered" id="serviceRegistered_disable" value="-1" />
                                     否
                                 </label>
                             </div>
                         </div>
                     </div>
                     <div class="form-group">
                         <label for="serviceCasFilter" class="col-sm-3 control-label">CAS过滤路径</label>
                         <div class="col-sm-8">
                             <input id="serviceCasFilter" name="serviceCasFilter" type="text" class="form-control" />
                         </div>
                     </div>
                     <div class="form-group">
                         <label for="serviceThemeServer" class="col-sm-3 control-label">登录皮肤服务地址</label>
                         <div class="col-sm-8">
                             <input id="serviceThemeServer" name="serviceThemeServer" type="text" class="form-control" />
                         </div>
                     </div>
                     <div class="form-group">
                         <label for="serviceId" class="col-sm-3 control-label">服务ID</label>
                         <div class="col-sm-8">
                             <input id="serviceId" name="serviceId" type="text" class="form-control" />
                         </div>
                     </div>
                     <div class="form-group">
                         <label for="serviceDescription" class="col-sm-3 control-label">服务简介</label>
                         <div class="col-sm-8">
                             <textarea id="serviceDescription" name="serviceDescription" type="" class="form-control"/>
                         </div>
                     </div>
        <br />
        <button type="button" class="btn btn-primary btn-block" onclick="doCreate()">保 存</button>

    </form>

</div>

<div th:replace="/layout/js :: #js"></div>
<script type="text/javascript" th:src="@{/js/modalPage.js}"></script>

<script>
    function doCreate(){
        $.ajax({
            type: 'post',
            url: '/system/theme',
            data: $('#createForm').serialize(),
            success: function(result) {
                if (result.status != 0) {
                    failHandler(result);
                } else {
                    successConfirm();
                    closeModal();
                }
            },
            error: errorHandler
        });
    }
</script>
</body>
</html>